def consumer():
    r = ''
    while True:
        n = yield r
        # if not n:
        #     return
        print('[CONSUMER] Consuming %s...' % n)
        r = '200 OK'


def produce(c):
    next(c)
    x = 0
    while x < 5:
        x = x + 1
        print('[PRODUCER] Producing %s...' % x)
        r = c.send(x)
        print('[PRODUCER] Consumer return :%s' % r)
    c.close()


# if __name__ == '__main__':
#     m = consumer()
#     produce(m)


def gen():
    for i in range(10):
        x = yield i
        print('值是%s'%x)

if __name__ == '__main__':
    c = gen()
    next(c)
    for i in range(61,1,-1):
        c.send(i)
    #c.close()
   # next(c)
    next(c)